package schoolword;

public class Animal {
    void voice() {
        System.out.println("动物在叫");
    }
}

class Dog extends Animal {
   public void voice() {
        System.out.println("汪汪");
    }
}


class Cat extends Animal {
    void voice() {
        System.out.println("喵喵");
    }

    public static void main(String[] args) {
        Dog doggie = new Dog();
        doggie.voice();
        Cat kitty = new Cat();
        kitty.voice();
    }
}